import book.BookList;
import user.AdminUser;
import user.NomalUser;
import user.User;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-03-23
 * Time: 20:37
 */
public class Main {
    public static User login(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入姓名：");
        String name = scanner.nextLine();
        System.out.println("请输入你的身份：1.管理员，0.用户");
        int input = scanner.nextInt();
        if(input == 1) {
            return new AdminUser(name);
        } else {
            return new NomalUser(name);
        }
    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = login();
        user.menu();
        while (true){
            System.out.println("请输入你的操作：");
            Scanner scanner = new Scanner(System.in);
            int choice = scanner.nextInt();
            user.doOperatation(choice,bookList);
        }

    }
}
